package com.kcht.sylyg08.dao.impl;

import com.kcht.adp.common.log.Logger;
import com.kcht.adp.common.sql.JPAConfig;
import com.kcht.sylyg08.dao.DataSourceBaseDao;
import com.kcht.sylyg08.dao.IContainerTagBoundDao;
import com.kcth.sylyg08.entity.ContainerTagBound;

import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.inject.Inject;

@Singleton
@Startup
@JPAConfig(dynaSqlFile = "mapper/containerTagBoundQueryMapper.xml")
public class ContainerTagBoundDao extends DataSourceBaseDao<ContainerTagBound, Long> implements IContainerTagBoundDao {
    @Inject
    private Logger log;

    @Override
    public ContainerTagBound getByContaienrId(String containerId) {
        return this.selectOneByJPQL("select a from ContainerTagBound a where a.containerId=?", containerId);
    }

    @Override
    public ContainerTagBound getByECP(String epc) {
        return this.selectOneByJPQL("select a from ContainerTagBound a where a.epc=?", epc);
    }
}
